<?php
/**
 * FunAdmin
 * ============================================================================
 * 版权所有 2017-2028 FunAdmin，并保留所有权利。
 * 网站地址: http://www.FunAdmin.com
 * ----------------------------------------------------------------------------
 * 采用最新Thinkphp6实现
 * ============================================================================
 * Author: yuege
 * Date: 2017/8/2
 */

namespace app\frontend\controller;

use app\common\controller\Frontend;
use EasyWeChat\Factory;
use EasyWeChat\OfficialAccount\Application;
use think\App;
use think\captcha\facade\Captcha;

class Index extends Frontend
{
//    protected $layout='';

    protected Application $wechat;

    public function __construct(App $app)
    {

        parent::__construct($app);
        $config = config('easywechat.OfficialAccount');
        $this->wechat = Factory::officialAccount($config);
    }

    public function index()
    {
        if (session('?mid')) {
            $this->redirect('member');
        } else {
            $this->redirect('login');
        }
//        return view('index');
    }

    /**
     * @return \think\Response
     * 验证码
     */
    public function verify()
    {
        return Captcha::create();
    }

}